import pdfplumber

with pdfplumber.open('test.pdf') as pdf:
    pages2parse = pdf.pages

    i = 0
    for pdf_page in pages2parse:
        '''
        print(pdf_page.extract_text())
        tables = pdf_page.extract_tables()
        print(tables)
        print(type(tables))
        '''
        for img in pdf_page.images:
            bbox = (img["x0"], img["top"], img["x1"], img["bottom"])
            cropped_page = pdf_page.crop(bbox)
            im = cropped_page.to_image(resolution=1080)
            print(im)
            print(type(im))
            im.save(f'{i}.png')
            i = i + 1
